package com.cj.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.cj.entity.News;
import com.cj.mapper.NewsMapper;

//@RestController
/*public class TestController {
	
	@Autowired
	RedisTemplate<String, String> redisTemplate;
	
	@Autowired
	NewsMapper newsMapper;
	
	@RequestMapping("/get")
	public String get() {
		return redisTemplate.opsForValue().get("name");
	}
	
	@RequestMapping("/put/{value}")
	public String put(@PathVariable("value") String value) {
		redisTemplate.opsForValue().set("name", value);
		return "success";
	}
	
	@RequestMapping("/getNews")
	public String getNews() {
		List<News> newList = newsMapper.selectList(null);
		for (News news : newList) {
			String json1 = JSON.toJSONString(news);
			System.out.println(json1);
			
		}
		return "success";
	}
	

}
*/